/**
 * 自动生成！请勿修改！
 */
import { command } from '../core/command';

class RotaryEncoder {
    static categoryCode = '010080015';

    static categoryName = '旋转编码器';

    device = {};

    opts = {};

    _to = undefined;

    constructor(opt = {}) {
        const { device, to, ...opts } = opt;

        this.device = device;
        this.opts = opts;
        this._to = to;
    }

    get categoryCode() {
        return RotaryEncoder.categoryCode;
    }

    get categoryName() {
        return RotaryEncoder.categoryName;
    }

    getButtonStatus(params) {
        return command({
            method: 'getButtonStatus',
            methodId: 'pUPQZrXI',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getGear(params) {
        return command({
            method: 'getGear',
            methodId: 'ppAXNAyz',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getRotationDirection(params) {
        return command({
            method: 'getRotationDirection',
            methodId: 'peH32CJW',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }
}

export default RotaryEncoder;
